﻿@model List<RecipientInfoVM>

    <div class="row">
        @foreach (var item in Model)
        {
            <div class="col-sm-4 item-container">               
                <a href="#" class="panel @(item.IsDefault ? "panel-primary":"panel-default") address" data-id="@item.Id")">
                    <div class="panel-heading">
                        收件人：@item.Recipient
                    </div>
                    <div class="panel-body">
                        <ul class="list-unstyled">
                            <li>@item.ProvinceName @item.CityName @item.DistrictName @item.Address</li>
                            <li>手机：@item.Mobile</li>
                            <li>电话：@item.Phone</li>
                            <li>邮编：@item.Postcode</li>
                        </ul>
                    </div>                    
                </a>
            </div>
        }
    </div>

@{ 
    var add = Model.Where(m => m.IsDefault).FirstOrDefault();
}
   @if (add != null)
   {
    <input id="addressId" name="addressId" value="@add.Id" type="hidden" />
   }
   else
   {
    <input id="addressId" name="addressId" type="hidden" value="0"/>
   }


<!-- /.container -->